package cm.sms.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import cn.hutool.core.util.ArrayUtil;

/**
 * @author: yxh
 * @Description: 短信发送渠道
 * @Date: Created in 2022/8/19 14:23
 * @Modified By:
 */
@Getter
@AllArgsConstructor
public enum SmsChannelEnum {

    DEBUG_DING_TALK("DEBUG_DING_TALK", "调试(钉钉)"),
//    YUN_PIAN("YUN_PIAN", "云片"),
    ALIYUN("ALIYUN", "阿里云"),
    TENCENT("TENCENT", "腾讯云"),
//    HUA_WEI("HUA_WEI", "华为云"),
    ;

    private String code;
    private String name;

    public static SmsChannelEnum getByCode(String code) {
        return ArrayUtil.firstMatch(o -> o.getCode().equals(code), values());
    }

}
